using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Gladkikh.Sims2.Combiner.Controls
{
    public partial class WaitWindow : Form
    {
        public WaitWindow()
        {
            InitializeComponent();
        }

        private void WaitWindow_Load(object sender, EventArgs e)
        {
            Reset();
        }

        public void SetText(string text)
        {
            toolStripStatusLabel1.Text = text;
        }

        public void AddWait()
        {
            if (progressBar1.Value + 10 > progressBar1.Maximum)
                progressBar1.Value = progressBar1.Minimum;
            else
                progressBar1.Value += 10;
            
        }

        public void Reset()
        {
            progressBar1.Value = 0;
            toolStripStatusLabel1.Text = "";
        }

        public event EventHandler OnButtonCancelClick;

        private void toolStripSplitButtonCancel_ButtonClick(object sender, EventArgs e)
        {
            if (OnButtonCancelClick != null)
                OnButtonCancelClick(this, new EventArgs());
            this.Hide();
        }

    }
}
